home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11166 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  470 b 

  1. Path: ping.be!news
  2. From: <>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Float to String
  5. Date: 22 Mar 1996 07:20:04 GMT
  6. Organization: PING Belgium
  7. Message-ID: <4itkb4$ggu@ping1.ping.be>
  8. NNTP-Posting-Host: dialup44.hasselt.eunet.be
  9.  
  10. scoshe@ix.netcom.com(Christopher Scott Shelton ) writes:
  11. > Is it possible to convert a float to a string?  like the itoa function.
  12.  
  13. Use the sprintf function:
  14. f.e.    float val=12.345F;
  15.         char string[10];
  16.         sprintf (string,"%f",val);
  17.  
  18.